﻿@model AddressAttributeSearchModel

<div class="panel panel-default">
    <div class="panel-heading">
        @T("Admin.Address.AddressAttributes")
    </div>
    <div class="panel-body">
        <p>
            <em>@T("Admin.Address.AddressAttributes.Description")</em>
        </p>
        @await Html.PartialAsync("Table", new DataTablesModel
        {
            Name = "addressattributes-grid",
            UrlRead = new DataUrl("List", "AddressAttribute", null),
            Length = Model.PageSize,
            LengthMenu = Model.AvailablePageSizes,
            ColumnCollection = new List<ColumnProperty>
            {
                new ColumnProperty(nameof(AddressAttributeModel.Name))
                {
                    Title = T("Admin.Address.AddressAttributes.Fields.Name").Text,
                    Width = "300"
                },
                new ColumnProperty(nameof(AddressAttributeModel.AttributeControlTypeName))
                {
                    Title = T("Admin.Address.AddressAttributes.Fields.AttributeControlType").Text,
                    Width = "200"
                },
                new ColumnProperty(nameof(AddressAttributeModel.IsRequired))
                {
                    Title = T("Admin.Address.AddressAttributes.Fields.IsRequired").Text,
                    Width = "100",
                    ClassName = NopColumnClassDefaults.CenterAll,
                    Render = new RenderBoolean()
                },
                new ColumnProperty(nameof(AddressAttributeModel.DisplayOrder))
                {
                    Title = T("Admin.Address.AddressAttributes.Fields.DisplayOrder").Text,
                    Width = "100",
                    ClassName =  NopColumnClassDefaults.CenterAll
                },
                new ColumnProperty(nameof(AddressAttributeValueModel.Id))
                {
                    Title = T("Admin.Common.Edit").Text,
                    Width = "80",
                    Render = new RenderButtonEdit(new DataUrl("~/Admin/AddressAttribute/Edit/"))
                }
            }
        })
    </div>
    <div class="panel-footer">
        <a asp-action="Create" asp-controller="AddressAttribute" class="btn btn-primary">
            <i class="fa fa-plus-square"></i>
            @T("Admin.Common.AddNew")
        </a>
    </div>
</div>